//
//  EditInfoViewController.m
//  DefendHealth
//
//  Created by 吾诺翰卓003 on 17/2/22.
//  Copyright © 2017年 iMacOne. All rights reserved.
//

#import "EditInfoViewController.h"

@interface EditInfoViewController ()

@end

@implementation EditInfoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.TitleNav.text = @"编辑个人信息";
    self.leftbutton.hidden = YES;
    
    UIButton *releaseBtn = [[UIButton alloc] initWithFrame:CGRectMake(WindowWidth-10-[ToolUtil autoWidth:@"跳过" width:500 height:13 num:13], 23, [ToolUtil autoWidth:@"跳过" width:500 height:13 num:13], 40)];
    [releaseBtn setTitle:@"跳过" forState:UIControlStateNormal];
    [releaseBtn addTarget:self action:@selector(release:) forControlEvents:UIControlEventTouchUpInside];
    releaseBtn.titleLabel.font = FONT(13);
    releaseBtn.titleLabel.textAlignment = 2;
    [releaseBtn setTitleColor:[ImageUtil colorWithRgb:0x666666] forState:0];
    [self.view addSubview:releaseBtn];
    
    [self addView];
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)release:(UIButton *)btn{
    [self.navigationController popToRootViewControllerAnimated:YES];
}
-(void)addView{
    UIImageView *touxiang = [UIImageView new];
    touxiang.frame = CGRectMake((WindowWidth-100)/2, 64+50, 100, 100);
    touxiang.backgroundColor = [UIColor grayColor];
    touxiang.layer.cornerRadius = 50;
    touxiang.layer.masksToBounds = YES;
    [self.view addSubview:touxiang];
    
    UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake((WindowWidth-62-80)/2, kMaxY(touxiang.frame)+12, 31, 31)];
    [btn1 setTitle:@"男" forState:UIControlStateNormal];
//    [btn1 addTarget:self action:@selector(nan) forControlEvents:UIControlEventTouchUpInside];
    btn1.titleLabel.font = FONT(13);
    btn1.layer.cornerRadius = 15.5;
    btn1.layer.masksToBounds = YES;
    btn1.backgroundColor = [UIColor grayColor];
    [btn1 setTitleColor:[ImageUtil colorWithRgb:0xffffff] forState:0];
    [self.view addSubview:btn1];
    
    UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(kMaxX(btn1.frame)+80, kMaxY(touxiang.frame)+12, 31, 31)];
    [btn2 setTitle:@"女" forState:UIControlStateNormal];
    //    [btn1 addTarget:self action:@selector(nan) forControlEvents:UIControlEventTouchUpInside];
    btn2.titleLabel.font = FONT(13);
    btn2.layer.cornerRadius = 15.5;
    btn2.layer.masksToBounds = YES;
    btn2.backgroundColor = [UIColor grayColor];
    [btn2 setTitleColor:[ImageUtil colorWithRgb:0xffffff] forState:0];
    [self.view addSubview:btn2];
    
    NSArray *titleArr = @[@"昵称：",@"生日：",@"身高：",@"体重："];
    for (int i = 0 ; i<titleArr.count; i++) {
        UIView *view1 = [UIView new];
        view1.frame = CGRectMake(0, kMaxY(btn1.frame)+25+47*i,WindowWidth , 47);
        view1.backgroundColor = [UIColor whiteColor];
        [self.view addSubview:view1];
        
        UILabel *lab1 = [UILabel new];
        lab1.frame = CGRectMake(70, 0, [ToolUtil autoWidth:titleArr[i] width:500 height:14 num:14], 47);
        lab1.text = titleArr[i];
        lab1.font = FONT(14);
        lab1.textColor = UIColorFromRGB(0x464646);
        lab1.textAlignment = 0;
        [view1 addSubview:lab1];
        
        UITextField * nameTf = [UITextField new];
        nameTf.frame = CGRectMake(kMaxX(lab1.frame)+5, 0, WindowWidth, 47);
        nameTf.delegate = self;
        [view1 addSubview:nameTf];
        nameTf.font = FONT(14);
        
        UIView *hui = [UIView new];
        hui.frame = CGRectMake(70, 46,WindowWidth-140 , 1);
        hui.backgroundColor = kLineColor;
        [view1 addSubview:hui];
        
        if (i == 3) {
            hui.hidden = YES;
        }
    }
    
    UIButton * loginBtn = [UIButton creatBtnWithFrame:CGRectMake(50, kMaxY(btn1.frame)+47*4+60-20, kScreenWidth-100, 40) btnTitle:@"下一步" btnTitleColor:kWhiteColor btnTitleFont:18 btnTagPrice:0 btnSetImage:nil btnBackgroundColor:UIColorFromRGB(0x7b7c7c) isCorner:YES action:^(UIButton *button) {
        [self.navigationController popToRootViewControllerAnimated:YES];
        
    }];
    loginBtn.layer.cornerRadius = 20;
    
    [self.view addSubview:loginBtn];
    
}
@end
